<?php
    @include_once("common.php");
    //print_r($conn);
    $user =$_POST["user"];
    $pwd =$_POST["pwd"];
    $phone = $_POST["phone"];
    $email = $_POST["email"];
    if(!($user&&$pwd&&$phone&&$email)) {
        argErr();
    }
    $insert="insert into `userlist` (user,pwd,phone,email) values ('$user','$pwd','$phone','$email')";
    mysqli_query($conn,$insert);
    $rows =mysqli_affected_rows($conn);
    $obj =array();
    if($rows>0) {
        $obj["status"] = true;
        $obj["detail"] = "新增成功";
    } else {
        $obj["status"]=false;
        $obj["detail"] = "sql语法错误";
        $obj["sql"] =$insert;
    }
    echo json_encode($obj);
?>